package tech.aistar.corejava.day14;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * Created by 豆梦寒 on 2019/8/2.
 */
public class FileReaderDemo {
    public static void main(String[] args) {
        BufferedReader br= null;
        try {
            br = new BufferedReader(new FileReader("src/tech/aistar/corejava/day14/IODemo01.java"));
            while (true){
//                int len = br.read();//读取单个字符
//
//                if(len == -1){
//                    break;
//                }
//                System.out.print((char)len);

                String line = br.readLine();//读取一整行
                if(line==null)
                    break;

                System.out.println(line);

            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
